<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@page import="java.util.*, java.sql.*, data.*" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Where You From?</title>
</head>
<body>


	
	
	<c:forEach items="${formData}" var="line">
		<c:out value="${line}" /><br>
	</c:forEach>
	<br>
	<br>
	In which county do you hold your primary citizenship?<br><br>
  	
	<%
	
	
	
	ResultSet rset = (ResultSet) request.getAttribute("crsCountries");
	Vector<String> countries = new Vector<String>();
	Vector<String> countryID = new Vector<String>();
	while(rset.next())
	{
		countryID.add(rset.getString("id"));
		countries.add(rset.getString("country"));
	}
	
	%>

	<div id="left_wrapper">
	<div id="left">
	<p>
	
	<%
	for(int i=0; i<countries.size()/3; i++)
	{%>
		<html:link action="/pages/students/Residency">
			<html:param name="citizenID" value="<%= countryID.get(i) %>" />
			<html:param name="citizen" value="<%= countries.get(i) %>" />
			<%= countries.get(i) %>
		</html:link>
		<br>
			
		
	<%}%>
	
	</p>
	</div>
	</div>
	
	<div id="middle_wrapper">
	<div id="left">
	<p>
	
	<%
	for(int i=countries.size()/3; i< 2 * (countries.size()/3); i++)
	{%>
		<html:link action="/pages/students/Residency">
			<html:param name="citizenID" value="<%= countryID.get(i) %>" />
			<html:param name="citizen" value="<%= countries.get(i) %>" />
			<%= countries.get(i) %>
		</html:link>
		<br>

	<%} %>
	
	</p>
	</div>
	</div>
	
	<div id="right_wrapper"> 
	<div id="right">
	<p>
	
	<%
	for(int i= 2 * (countries.size()/3); i< countries.size(); i++)
	{%>
		<html:link action="/pages/students/Residency">
			<html:param name="citizenID" value="<%= countryID.get(i) %>" />
			<html:param name="citizen" value="<%= countries.get(i) %>" />
			<%= countries.get(i) %>
		</html:link>
		<br>

	<%} %>
	
	</p>
	</div>
	</div>


	


<br><br>

	</body>
</html>